﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UtilZ.Dotnet.Ex.Communication.Net.Web
{
    /// <summary>
    /// 消息接口
    /// </summary>
    public interface IWebSocketMessage : IDisposable
    {
        /// <summary>
        /// 获取消息类型
        /// </summary>
        WebSocketMessageTypes MessageType { get; }

        /// <summary>
        /// 获取操作码
        /// </summary>
        /// <returns>操作码</returns>
        byte GetOpcode();

        /// <summary>
        /// 发送消息到客户端
        /// </summary>
        /// <param name="stream"></param>
        void Send(Stream stream);

        /// <summary>
        /// 暂停发送
        /// </summary>
        void Pause();

        /// <summary>
        /// 继续发送
        /// </summary>
        void Resume();
    }
}
